import { _decorator, Component, Node, RigidBody } from 'cc';
import { PHY_GROUP } from './RigidBodyMaskCustom';
const { ccclass, property, requireComponent } = _decorator;

/**
 * 掩码选择,依赖RigidBody
 */
@ccclass('RigbodyMaskSelect')
@requireComponent(RigidBody)
export class RigbodyMaskSelect extends Component {
    @property({
        type: PHY_GROUP
    })
    mask = PHY_GROUP.DEFAULT


    start() {
        this.node.getComponent(RigidBody)?.setMask(this.mask) 
        // console.log(`${this.node.name}set mask`, this.node.getComponent(RigidBody)?.getMask());
    }
}


